﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace RiskMan.DataClass.AlfaDirectFolder
{
    /// <summary>
    /// ТАБЛИЦА «BOARDS» - СПРАВОЧНИК ТОРГОВЫХ РАЗДЕЛОВ
    /// Ключевое поле: board_code
    /// </summary>
    public class Boards : INotifyPropertyChanged
    {
        #region Private
        private string _boardCode;
        private string _placeCode;
        private string _boardName;
        private double _tax;
        private string _priceType;
        private int _iLastUpdate;
        private string _placeName;

        #endregion

        #region Public

        /// <summary>
        /// Код торгового раздела.
        /// </summary>
        public string BoardCode
        {
            get { return _boardCode; }
            set
            {
                if (_boardCode != value)
                    _boardCode = value;

                RaisePropertyChanged("BoardCode");
            }
        }
        /// <summary>
        /// Код рынка.
        /// </summary>
        public string PlaceCode
        {
            get { return _placeCode; }
            set
            {
                if (_placeCode != value)
                    _placeCode = value;

                RaisePropertyChanged("PlaceCode");
            }
        }
        /// <summary>
        /// Название торгового раздела.
        /// </summary>
        public string BoardName
        {
            get { return _boardName; }
            set
            {
                if (_boardName != value)
                    _boardName = value;

                RaisePropertyChanged("BoardName");
            }
        }
        /// <summary>
        /// Комиссия.
        /// </summary>
        public double Tax
        {
            get { return _tax; }
            set
            {
                if (_tax != value)
                    _tax = value;

                RaisePropertyChanged("Tax");
            }
        }
        /// <summary>
        ///Тип цены («%» - в процентах от номинала, «$» – в валюте котировки).
        /// </summary>
        public string PriceType
        {
            get { return _priceType; }
            set
            {
                if (_priceType != value)
                    _priceType = value;

                RaisePropertyChanged("PriceType");
            }
        }
        /// <summary>
        /// Временная метка последнего обновления.
        /// </summary>
        public int ILastUpdate
        {
            get { return _iLastUpdate; }
            set
            {
                if (_iLastUpdate != value)
                    _iLastUpdate = value;

                RaisePropertyChanged("ILastUpdate");
            }
        }
        /// <summary>
        /// Название рынка.
        /// </summary>
        public string PlaceName
        {
            get { return _placeName; }
            set
            {
                if (_placeName != value)
                    _placeName = value;

                RaisePropertyChanged("PlaceName");
            }
        }

     
        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
